package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.factory.RemoteQYLoginFallbackFactory;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
 * 企业微信接口
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteQYLoginService",url = "${go_wx_url}", fallbackFactory = RemoteQYLoginFallbackFactory.class)
public interface RemoteQYLoginService
{
    /**
     * 获取登录二维码
     */
    @PostMapping(value = "/login/get_login_qrcode", consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
     String get_login_qrcode(@RequestBody HashMap<String, List<HashMap<String,Object>>>  map);
    /**
     * 检查登录二维码
     */
    @PostMapping(value = "/login/check_login_qrcode", consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
     String check_login_qrcode(@RequestBody HashMap<String, List<HashMap<String,Object>>>  map);
  /**
     * 推送手机确认登录通知
     */
    @PostMapping(value = "/login/push_login_url", consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
     String push_login_url(@RequestBody HashMap<String, List<HashMap<String,Object>>>  map);

  /**
     * 登录验证码,当二维码回调 status == QRCODE_REQUIRE_VERIFY(10) 时， 也就是需要登录验证了，在业务前端让用户输入验证码
     */
    @PostMapping(value = "/login/verify_login_qrcode", consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
     String verify_login_qrcode(@RequestBody HashMap<String, List<HashMap<String,Object>>>  map);
 /**
     *自动登录,模拟退出企微，重新打开自动登录的场景
     */
    @PostMapping(value = "/login/auto_login", consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
     String auto_login(@RequestBody HashMap<String, List<HashMap<String,Object>>>  map);


}
